#ifndef __XMPP_BOT_H__
#define __XMPP_BOT_H__
#include "defines.h"
#include <string>
#include "iksemel.h"
#include "IoOps.h"
#include "xmppFilter.h"
#include "xmppLogger.h"

class xmppBot {
  public:
    xmppBot(IoOps *iops, xmppFilter *filter,
            bool t, xmppLogger *logger=NULL);
    xret setJID(std::string &jid, std::string &passwd);
    xret processXMPP(const int timeout=-1);
  protected:
    xret xmpp_init(void);
    static int xmpp_hook_stream(xmppBot *xb, int type, iks *node);
  #if defined(__NEED_DEBUG__)
    static void xmpp_hook_log(xmppBot *xb, const char *data, size_t size, int
                                is_incoming);
  #endif
  private:
    bool useTls, _authorized,_error;
    int _features;
    std::string jid ,j_password;
    iksparser *_parser;
    iksid *_account;
    iksfilter *_filters;
    IoOps *io;
    xmppFilter *absFilter;
    xmppLogger *log;
    int _interval;   //in seconds
    bool publishHeartbeat;
};

#endif
/*
vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=4:softtabstop=2:encoding=utf-8:textwidth=80
*/
